const path = require('path')
const webpackExternals = require('webpack-node-externals')

module.exports = {
  target: 'node',
  mode: process.env.NODE_ENV === "production" ? "production" : "development",
  entry: path.resolve(__dirname,"../server/index.js"),
  output: {
    filename: "index.js",
    path: path.resolve(__dirname,"../dist-server"),
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        loader: 'babel-loader',
        exclude: '/node_modules/',
      },
    ],
  },
  externals: [webpackExternals()],
}
